package br.rafael.mulock.controle_de_estoque.visao.telas;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

import br.rafael.mulock.controle_de_estoque.controle.LoginAction;
import br.rafael.mulock.controle_de_estoque.utilitarios.Texto;

class TelaVendaEstoque extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	
	/**
	 * Create the frame.
	 */
	public TelaVendaEstoque() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("Controle de estoque");
		setResizable(false);
		setBounds(100, 100, 450, 330);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(null);
		setContentPane(contentPane);
		
		Texto texto = new Texto();
		
		JButton btnVenda = new JButton("");
		btnVenda.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();
				TelaVenda telaVenda = new TelaVenda();
				telaVenda.setVisible(true);
			}
		});
		btnVenda.setIcon(new ImageIcon(getClass().getResource(texto.get("imagens.cifrao"))));
		btnVenda.setBounds(80, 32, 58, 90);
		contentPane.add(btnVenda);
		
		JLabel lblVenda = new JLabel("Venda");
		lblVenda.setHorizontalAlignment(SwingConstants.CENTER);
		lblVenda.setBounds(80, 133, 58, 14);
		contentPane.add(lblVenda);
		
		JButton btnEstoque = new JButton("");
		btnEstoque.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
				TelaEstoque telaEstoque = new TelaEstoque();
				telaEstoque.setVisible(true);
			}
		});
		btnEstoque.setIcon(new ImageIcon(getClass().getResource(texto.get("imagens.estoque"))));
		btnEstoque.setBounds(257, 32, 90, 90);
		contentPane.add(btnEstoque);
		
		JLabel lblEstoque = new JLabel("Estoque");
		lblEstoque.setHorizontalAlignment(SwingConstants.CENTER);
		lblEstoque.setBounds(257, 133, 90, 14);
		contentPane.add(lblEstoque);
		
		JButton btnLogoff = new JButton("");
		btnLogoff.setLocation(187, 211);
		btnLogoff.setSize(70, 75);
		btnLogoff.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				LoginAction.logoff();
				dispose();
				TelaPrincipal telaPrincipal = new TelaPrincipal();
				telaPrincipal.setVisible(true);
			}
		});
		btnLogoff.setIcon(new ImageIcon(getClass().getResource(texto.get("imagens.logoff"))));
		btnLogoff.setBounds(173, 186, 70, 75);
		contentPane.add(btnLogoff);
		
		JLabel lblSair = new JLabel("Sair");
		lblSair.setHorizontalAlignment(SwingConstants.CENTER);
		lblSair.setBounds(173, 266, 70, 14);
		contentPane.add(lblSair);
		
	}
}
